package com.example.消息可靠性.发送方保证.发送方确认机制;

import org.springframework.amqp.rabbit.connection.CorrelationData;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ConfirmController {

    @Autowired
    RabbitTemplate rabbitTemplate;

    @GetMapping("/sendConfirm")
    public void send(){
        rabbitTemplate.convertAndSend(ConfirmConfig.CONFIRM_EXCHANGE,ConfirmConfig.CONFIRM_QUEUE,"hello",new CorrelationData());
    }

}
